﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Business_Layer;

namespace Control_Layer
{
    // See UseCase:
    // UCD00-ADDITIONS (01)
    public class CCAddRelation
    {
        private Service service;
        private Project project;

        public CCAddRelation()
        {
            service = Service.GetInstance;
            project = service.GetProject;
        }

        /// <summary>
        /// Adds a relation between two selected components.
        /// </summary>
        /// <param name="sx">The X Coordinate for checking Body 1.</param>
        /// <param name="sy">The Y Coordinate for checking Body 1.</param>
        /// <param name="ex">The X Coordinate for checking Body 2.</param>
        /// <param name="ey">The Y Coordinate for checking Body 2.</param>
        /// <param name="text">The relation's name.</param>
        public void Add(int sx, int sy, int ex, int ey, string text)
        {
            project.AddComponent(TypeComponent.Relation, sx, sy, ex, ey, text);
        }
    }
}
